package com.starinside.wp.repository;

import com.starinside.wp.domain.RelClassesChildren;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface RelClassesChildrenRepository extends JpaRepository<RelClassesChildren, String>, JpaSpecificationExecutor<RelClassesChildren> {

    @Query(value = "SELECT classesId FROM rel_classes_children WHERE childrenId = :childrenId", nativeQuery = true)
    List<String> findClassesIdsByChildrenId(@Param("childrenId") String childrenId);
}
